package com.bw.user.mvvm.view.fragment;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import androidx.appcompat.app.AppCompatActivity;

import com.blankj.utilcode.util.BarUtils;
import com.blankj.utilcode.util.ToastUtils;
import com.bw.mvvm_common.dao.UserBeanDao;
import com.bw.mvvm_common.mvvm.utils.GreenDaoUtils;
import com.bw.user.R;

public class DeletActivity extends AppCompatActivity implements View.OnClickListener {

    private Button deletSql;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        BarUtils.setStatusBarLightMode(this,true);
        BarUtils.transparentStatusBar(this);
        setContentView(R.layout.activity_delet);
        initView();
        deletSql.setOnClickListener(this);
    }

    private void initView() {
        deletSql = (Button) findViewById(R.id.deletSql);
    }

    @Override
    public void onClick(View v) {
        int id = v.getId();
        if (id == R.id.deletSql) {
            UserBeanDao green = GreenDaoUtils.getGreenDaoUtils().green();
            green.deleteAll();
            finish();
        }
    }
}